package bjut.core.loadbalance;

import bjut.core.Message.RpcRequest;

import java.util.List;
import java.util.Random;

/**
 * @Author: zhuzhiming
 * @Date: 2022/4/21 18:47
 */
public class RandomLoadBalance extends LoadBalanceAbstract {

    @Override
    protected String doSelect(List<String> serviceAddresses, RpcRequest rpcRequest) {
        Random random = new Random();
        return serviceAddresses.get(random.nextInt(serviceAddresses.size()));
    }

}
